/* ** Filename: HTMLThor.thor ** ** $VER: v1.31 (09.22.96) ** ** Author: Troy E. Bouchard ** ** EMail: tbouchar@ptialaska.net ** Webpage: http://www.ptialaska.net/~tbouchar ** */ /* Find our Thor Port and number! */ p = ' '||Address() || ' ' || show('P',,) ThorPort = pos(' THOR.',p) if ThorPort > 0 then ThorPort = word(substr(p,ThorPort+1),1) else do say "Can't seem to find the Thor port!" exit 10 End /* Load the BBSRead library up! */ if ~show('p', 'BBSREAD') then do address command "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead" "WaitForPort BBSREAD" End /* change these to match your system! */ TB_WWW = 'A HREF="digest/' TB_EMail = 'A HREF="mailto:' TB_MSGPATH = 'T:' EXT = '.html' /* change this to .htm if you need to. */ /* aint ARexx just great? */ TB_WDAYS = 'Monday Tuesday Wednesday Thursday Friday Saturday Sunday' TB_MONTH = 'January February March April May June July August September October November December' options results Call GetPages Exit GetPages: Address BBSREAD 'GETBBSLIST stem "'BBSLIST'"' if(rc ~=0) then do Address(ThorPort) 'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"' exit End Address(ThorPort) 'REQUESTLIST instem "'BBSLIST'" outstem "'TB_SYSTEM'" title "Selection:" DRAGSELECT MULTISELECT SIZEGADGET' if(rc ~= 0) then exit do i=1 to TB_SYSTEM.COUNT Address BBSREAD 'GETCONFLIST "'TB_SYSTEM.i'" CONFLIST' if(rc ~= 0) then do Address(ThorPort) 'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"' exit End Address(ThorPort) 'REQUESTLIST instem "'CONFLIST'" title "Select conference on ' || TB_SYSTEM.i || ":" ||'" SIZEGADGET' if(rc ~= 0) then TB_CONFNAME = "" else TB_CONFNAME = result MyConf = Translate(TB_CONFNAME,," ","_") call open(out, TB_MSGPATH||MyConf||EXT, w) call writeln(out, ""MyConf||"") call writeln(out, "

"MyConf"


") call close(out) Address BBSREAD 'GETCONFDATA BBSName "'TB_SYSTEM.i'" ConfName "'TB_CONFNAME'" Stem CDATA' if(rc ~= 0) then do Address(ThorPort) 'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"' exit End Address(ThorPort) 'OPENPROGRESS TITLE " HTMLThor v1.31" PT "Getting Pages..." AT "_Abort" PCW 30' if(rc ~= 0) then do 'CLOSEPROGRESS REQ' win 'REQUESTNOTIFY TEXT "'THOR.LASTERROR'" BT "_OK"' exit end win = result do j = CDATA.FIRSTMSG to CDATA.LASTMSG Address(ThorPort) msgtext = 'Saving Page 'j' of 'CDATA.LASTMSG' to 'TB_MSGPATH||MyConf||j||EXT 'UPDATEPROGRESS REQ "'win'" TOTAL "'CDATA.LASTMSG'" CURRENT "'j'" PT "'msgtext'"' if(rc ~= 0) then do 'CLOSEPROGRESS REQ' win win=0 leave end Drop HeaderInfo. Drop TextInfo. Address BBSREAD 'READBRMESSAGE "'TB_SYSTEM.i'" "'TB_CONFNAME'" MSGNR "'j'" TextStem "'TextInfo'" HeadStem "'HeaderInfo'" DataStem "'MsgData'"' if(rc ~= 0) then do Address(ThorPort) 'CLOSEPROGRESS REQ' win 'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"' Exit end if ~bittst(MsgData.FLAGS, 5) then do 'AMIGA2DATE "'HeaderInfo.CREATIONDATE'" Stem "'Time'"' if(rc ~= 0) then do Address(ThorPort) 'CLOSEPROGRESS REQ' win 'REQUESTNOTIFY TEXT "'BBSREAD.LASTERROR'" BT "_OK"' Exit end if(Time.WDAY == '0') then WKDays = 'Sunday' else WKDays = word(TB_WDAYS, Time.WDAY) MODays = word(TB_MONTH, Time.MONTH) if symbol('HeaderInfo.FROMADDR') = "VAR" then Addr = '<'TB_EMail || value('HeaderInfo.FROMADDR') || '">' if symbol('HeaderInfo.FROMNAME') = "VAR" then Name = value('HeaderInfo.FROMNAME') || '' if symbol('HeaderInfo.SUBJECT') = "VAR" then Subj = value('HeaderInfo.SUBJECT') call open(out, TB_MSGPATH||MyConf||EXT, a) call writeln(out,'From:'Addr||Name'
Subject:<'TB_WWW||MyConf||j||EXT'">'Subj||'.'||'

') call close(out) anterior=j-1 proxima=j+1 if anterior=0 then anterior=1 call open(out, TB_MSGPATH || MyConf || j || EXT, w) call writeln(out, ''MyConf||' - 'Subj||'') call writeln(out, '

'MyConf||'

') call writeln(out, 'Message created on:
'WKDays', 'MODays' 'Time.MDAY', 'Time.YEAR'
') call writeln(out, '
From:'Addr||Name' ('HeaderInfo.FROMADDR')
Subject: 'Subj||'
') call writeln(out, '
|Previous Message | Next Message |
') call close(out) cnt = value('TextInfo.TEXT.COUNT') call open(out, TB_MSGPATH||MyConf||j||EXT, a) call writeln(out, '

') do n = 1 to cnt call writeln(out, value('TextInfo.TEXT.n')'
') end call writeln(out,'


| Previous Message | Next Message |
') call writeln(out,'Output created by HTMLThor v1.31
') call writeln(out,'Written by: Troy E. Bouchard, © 1996
') call writeln(out,"
") call close(out) end end call open(out, TB_MSGPATH||MyConf||EXT, a) call writeln(out,"") call close(out) end Address(ThorPort) 'REQUESTNOTIFY TEXT " We Are Done!\nHTML Files Copied!" BT "_Cool!"' 'CLOSEPROGRESS REQ' win Return